new Vue({
    el: '#app',
    data: {
        city: '',
        citys: [],
        value: '',
    },
    computed: {
        searchCitys: function () {
            var _this = this;
            return this.citys.filter(function (item) { return item.name.match(_this.value); });
        }
    },
    mounted: function () {
        this.city = $utils.query('city');
        this.main();
    },
    methods: {
        main: function () {
            var _this = this;
            $http.post('/member/api.users/get_province', {}).then(function (res) { return _this.citys = res.data; });
        },
        selectCity: function (e) {
            var el = $utils.getPathElement(e, 'van-cell');
            // 没有元素那就无效
            if (!el) {
                return;
            }
            var id = el.dataset['index'];
            location.href = "./index.html?city_id=" + id;
        },
    }
});
